package com.yy.controller.front;

import com.yy.entity.front.Orders;
import com.yy.service.front.OrdersService;
import com.yy.service.front.UserService;
import com.yy.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * create by KongFuning on 2022/8/4
 */
@RestController
@RequestMapping("/order")
@Slf4j
public class OrdersController {

    @Autowired
    private OrdersService ordersService;

    /*
    * 用户下单
    * */
    @PostMapping("/submit")
    public R submit(@RequestBody Orders orders){
        return ordersService.submit(orders);
    }

    /*
    * 查看订单
    * */
    @GetMapping("/userPage")
    public R orderPage(Integer page,Integer pageSize){
        return ordersService.orderPage(page, pageSize);
    }

}
